#include<iostream>
#include<cstring>
#include<algorithm>
#include<string>
using namespace std;
const int N = 1e5 + 10;
int n, m;
int a[N];
char s[60];
int main()
{
	int t;
	cin >> t;
	while (t--) {
		cin >> n >> m;
		for (int i = 1; i <= m; i++) {
			s[i] = 'B';
		}
		for (int i = 1; i <= n; i++) {
			cin >> a[i];
		}
		sort(a + 1, a + n + 1);
		for (int i = 1; i <= n; i++) {
			int x = min(a[i], m - a[i] + 1);
			int y = max(a[i], m - a[i] + 1);
			if (s[x] == 'A') {
				s[y] = 'A';
			}
			else s[x] = 'A';
		}
		for (int i = 1; i <= m; i++) {
			cout << s[i];
		}
		cout << endl;
	}
	return 0;
}